package pl.koziolekweb.szkola.NIXMLNet;

// NI-XMLNet/MyPanel.java
 
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.util.HashMap;

import javax.swing.JButton;
import javax.swing.JPanel;

public class MyPanel extends JPanel {

    public static final long serialVersionUID = 20061127;

    private HashMap<?,?> map;
    private JButton but;
    private JPanel  cen;

    public HashMap<?,?> getMap()            { return map;     }
    public void    setMap(HashMap<?,?> map) { this.map = map; }

    public JButton getBut()            { return but;     }
    public void    setBut(JButton but) {
        this.but = but;
        add(but,BorderLayout.SOUTH);
    }

    public JPanel getCen()            { return cen; }
    public void   setCen(JPanel cen ) {
        this.cen = cen;
        add(cen,BorderLayout.CENTER);
    }

    public MyPanel() {
        setLayout(new BorderLayout());
        JPanel pan = new JPanel();
        pan.setPreferredSize(new Dimension(300,300));
        pan.setOpaque(true);
        pan.setBackground(Color.BLACK);
        setCen(pan);
        setMap(new HashMap<Object, Object>());
        setBut(new JButton("Not Set"));
    }
}
